E
@bucknall Thank you so much for your help!
I'm ashamed but It was all my fault.
The LoRa antenna on one of the devices was not correctly wired, I'm using an extension cable ...
I modified the script so to have pong sending back some info:
Node A:
from network import LoRa
import socket
import time
lora = LoRa(mode=LoRa.LORA, frequency=915000000)
s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
s.setblocking(False)
while True:
rec = [s.recv(64).decode()]
if "Ping" in rec[0].split(" "):
print(rec[0])
s.send('Pong %s' % rec[0].split(" ")[-1])
time.sleep(5)
Node B
from network import LoRa
import socket
import time
lora = LoRa(mode=LoRa.LORA, frequency=915000000)
s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
s.setblocking(False)
x=0
while True:
s.send('Ping %s' % x)
time.sleep(5)
x=x+1
print(s.recv(64).decode())
I can send the code via wifi on the LoPy with no needs of microsd card on the device.
If the wifi connection drop or I close it, the LoRa communication keeps goig :)
when I reconnect with wifi in the atom shell I can actually see the ping number growing.
More post coming soon, but I'll make sure to check the wiring first ... I'm really excited!
Thanks!